package thread;

public class DaemonDemo {
    public static void main(String[] args) {
        Thread t1 = new Thread(){
            @Override
            public void run() {
                for (int i = 0; i < 10; i++) {
                    try {Thread.sleep(1000);
                        System.out.println("rose jump");
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        };

        Thread t2 = new Thread(){
            @Override
            public void run() {
                while (true){
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    System.out.println("jack  jump too");
                }
            }
        };

        t1.start();
        t2.setDaemon(true);
        t2.start();

    }
}
